package com.joysuch.wwyt.bp.entity.risk;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDate;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @Author ZhangDong
 * @Date 2020/3/6 10:32
 */
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_judge_depart")
@SQLDelete(sql = "update wwyt_bp_judge_depart set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_judge_depart set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Data
public class BpJudgeDepart {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键id-修改时有用")
    private Long id;

    //部门单位安全风险研判

    @ApiModelProperty("生产装置状态")
    private String produceDeviceStatus;

    @ApiModelProperty("是否处于试生产")
    private String preProduceOrNot;

    @ApiModelProperty("是否处于开停车状态")
    private String driveOrNot;

    @ApiModelProperty("重大危险源是否处于安全状态")
    private String harzardSafeOrNot;

    @ApiModelProperty("特种作业json串 -BpTeamSpecialBean")
    private String specialWork;

    @ApiModelProperty("装置开停车制定开停车方案")
    private String deviceDriveWay;

    @ApiModelProperty("试生产制定试生产方案并经专家论证")
    private String preProduceWayProof;

    @ApiModelProperty("变更是否有效执行,审批程序是否符合规定")
    private String changeAndApprove;

    @ApiModelProperty("研判人员")
    private Long judgeUserId;


    //部门单位安全承诺

    @ApiModelProperty("承诺内容")
    private String promiseContent;

    @ApiModelProperty("承诺人")
    private Long promiseUserId;

    @ApiModelProperty("上报日期 格式：yyyy-MM-dd")
    private LocalDate reportDate;

    @ApiModelProperty("上报人")
    private Long reportUserId;

    @ApiModelProperty("上报部门-实际是本部门")
    private Long higherDepartId;

    @ApiModelProperty("上报部门名称")
    @Transient
    private String higherDepartName;

    //班组上报材料

    @ApiModelProperty("班组上报材料-班组主键集合json串-Long")
    private String teamIds;


    @ApiModelProperty("发布状态")
    private String releaseStatus;

    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    private Long createBy;

    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    private java.time.LocalDateTime createTime;

    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    private java.time.LocalDateTime updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
